package com.nondo.rdp.finance.model.course;

import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.nondo.rdp.core.common.BeanUtils;
import com.nondo.rdp.core.model.AttachBean;
import com.nondo.rdp.finance.domain.course.Course;

public class CourseQuery {
	private Long id; // 课程ID
	private int type; // 课程类型
	private String name;// 课程名称
	private String description;// 课程简介
	private String teacher;// 讲师
	private AttachBean mainImg; // 课程封面
	private int free;// 是否免费
	private float price;// 当前价格
	private float rate;// 平均评分分数
	private int status; // 上下架状态
	private Date publishDate; // 发布日期
	private Date createDate; // 创建日期
	private String videoId; // 视频ID
	private Long sid;// 课节ID

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getTeacher() {
		return teacher;
	}

	public void setTeacher(String teacher) {
		this.teacher = teacher;
	}

	public AttachBean getMainImg() {
		return mainImg;
	}

	public void setMainImg(AttachBean mainImg) {
		this.mainImg = mainImg;
	}

	public int getFree() {
		return free;
	}

	public void setFree(int free) {
		this.free = free;
	}

	public float getPrice() {
		return price;
	}

	public void setPrice(float price) {
		this.price = price;
	}

	public float getRate() {
		return rate;
	}

	public void setRate(float rate) {
		this.rate = rate;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getPublishDate() {
		return publishDate;
	}

	public void setPublishDate(Date publishDate) {
		this.publishDate = publishDate;
	}

	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public String getVideoId() {
		return videoId;
	}

	public void setVideoId(String videoId) {
		this.videoId = videoId;
	}

	public Long getSid() {
		return sid;
	}

	public void setSid(Long sid) {
		this.sid = sid;
	}

	public static CourseQuery covert2Bean(Course course) {
		CourseQuery cq = new CourseQuery();
		BeanUtils.copy(course, cq);
		return cq;
	}

}
